package com.neuedu.utils;

import java.io.UnsupportedEncodingException;

public class Utf {
	/**
     * URL编码（utf-8）
     * @param source
     * @return
     */
    public static String urlEncodeUTF8(String source) {
        String result = source;
        try {
            result = java.net.URLEncoder.encode(source, "utf-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return result;
    }

	public static void main(String[] args) {
		
		String redirect_uri = urlEncodeUTF8("https://f85cddef.ngrok.io/wechatvote/getcode");
		System.out.println(redirect_uri);
	}
}
